#include "TanhLayer.h"
#include <math.h>
#include "../Initializers/NguyenWidrowFunction.h"

using namespace NeuralPlusPlus::Core;
using namespace NeuralPlusPlus::Core::Backpropagation;
using namespace NeuralPlusPlus::Core::Initializers;

double NeuralPlusPlus::Core::Backpropagation::TanhLayer::Derivative( double input, double output )
	{
	return (1 - (output * output));
	}

double NeuralPlusPlus::Core::Backpropagation::TanhLayer::Activate( double input, double previousOutput )
	{
	return tanh(input);
	}

NeuralPlusPlus::Core::Backpropagation::TanhLayer::TanhLayer( int neuronCount ) : ActivationLayer(neuronCount)
	{
	this->Initializer = new NguyenWidrowFunction();
	}